package cn.tedu.flower.manage.content.pojo.param;



import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;


@Data
public class AddressUpdateParam implements Serializable {

    /**
     *收货人姓名
     */
    @NotNull(message = "请提交收货人姓名")
    @Pattern(regexp = "^[\\u4E00-\\u9FFF]{0,4}$",
            message = "收货人姓名最长为四个汉字")
    @ApiModelProperty(value = "收货人姓名", required = true)
    private String name;
    /**
     * 发货人姓名
     */
    @NotNull(message = "请提交发货人姓名")
    @Pattern(regexp = "^[\\u4E00-\\u9FFF]{0,4}$",
            message = "发货人姓名最长为四个汉字")
    @ApiModelProperty(value = "发货人姓名", required = true)
    private String username;
    /**
     *收货人手机号
     */
    @NotNull(message = "请提交收货人电话号码")
    @Pattern(regexp = "^[0-9\\u4E00-\\u9FFF]{11}$",
            message = "收货人手机号为11位")
    @ApiModelProperty(value = "收货人电话", required = true)
    private String tel;
    /**
     *收货地址
     */
    @NotNull(message = "请提交收货人地址")
    private String address;
    /**
     *是否默认地址，1=是，0=不是
     */
    @NotNull(message = "请提交收货地址")
    @Range(max = 1, message = "是否启用的值必须是0或1")
    @ApiModelProperty(value = "是否启用，1=启用，0=未启用", required = true, example = "1")
    private Integer isDefault;
}
